import React,{useRef,forwardRef,useImperativeHandle} from 'react'

function Child4(props:any,ref:any) {
    let userageInput:any = useRef(null);

    useImperativeHandle(ref, () => ({
        
        getUserage: () => {
            return  userageInput.current.value;
        }
      }));

  return (
    <div>
        我是子组件
        数据 <input type="text" ref={userageInput} />
    </div>
  )
}

export default  forwardRef(Child4);
